﻿using System.Web.UI.WebControls;

namespace Medianamik.Core.Sugar
{
    public static class WebControlUtil
    {
        public static void SelectByValue(this DropDownList dropDownList, string value)
        {
            if (dropDownList.Items.Count > 0)
            {
                var listItem = dropDownList.Items.FindByValue(value);
                if (listItem != null)
                    dropDownList.SelectedValue = value;
            }
        }
    }
}
